Implement Bazel support for CI Visibility#11150
Implement Bazel support for CI Visibility#11150daniel-mohedano wants to merge 15 commits intomasterfrom
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 62 metrics, 9 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.62.0-SNAPSHOT~da57da8687, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1058111
Total [baseline] (11.121 s) : 0, 11121062
Agent [candidate] (1.061 s) : 0, 1060997
Total [candidate] (11.17 s) : 0, 11169834
section appsec
Agent [baseline] (1.254 s) : 0, 1254320
Total [baseline] (11.122 s) : 0, 11122059
Agent [candidate] (1.252 s) : 0, 1251996
Total [candidate] (11.077 s) : 0, 11077347
section iast
Agent [baseline] (1.238 s) : 0, 1237783
Total [baseline] (11.388 s) : 0, 11387828
Agent [candidate] (1.229 s) : 0, 1228589
Total [candidate] (11.347 s) : 0, 11347006
section profiling
Agent [baseline] (1.19 s) : 0, 1189875
Total [baseline] (11.08 s) : 0, 11080040
Agent [candidate] (1.211 s) : 0, 1211158
Total [candidate] (11.159 s) : 0, 11159088
gantt
title petclinic - break down per module: candidate=1.62.0-SNAPSHOT~da57da8687, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.227 ms) : 0, 1227
crashtracking [candidate] (1.221 ms) : 0, 1221
BytebuddyAgent [baseline] (633.992 ms) : 0, 633992
BytebuddyAgent [candidate] (632.926 ms) : 0, 632926
AgentMeter [baseline] (29.628 ms) : 0, 29628
AgentMeter [candidate] (29.86 ms) : 0, 29860
GlobalTracer [baseline] (248.83 ms) : 0, 248830
GlobalTracer [candidate] (250.495 ms) : 0, 250495
AppSec [baseline] (32.347 ms) : 0, 32347
AppSec [candidate] (32.613 ms) : 0, 32613
Debugger [baseline] (60.267 ms) : 0, 60267
Debugger [candidate] (60.307 ms) : 0, 60307
Remote Config [baseline] (601.663 µs) : 0, 602
Remote Config [candidate] (606.516 µs) : 0, 607
Telemetry [baseline] (8.851 ms) : 0, 8851
Telemetry [candidate] (9.18 ms) : 0, 9180
Flare Poller [baseline] (6.04 ms) : 0, 6040
Flare Poller [candidate] (7.541 ms) : 0, 7541
section appsec
crashtracking [baseline] (1.235 ms) : 0, 1235
crashtracking [candidate] (1.24 ms) : 0, 1240
BytebuddyAgent [baseline] (665.69 ms) : 0, 665690
BytebuddyAgent [candidate] (663.604 ms) : 0, 663604
AgentMeter [baseline] (12.34 ms) : 0, 12340
AgentMeter [candidate] (12.334 ms) : 0, 12334
GlobalTracer [baseline] (249.557 ms) : 0, 249557
GlobalTracer [candidate] (249.654 ms) : 0, 249654
AppSec [baseline] (185.765 ms) : 0, 185765
AppSec [candidate] (185.33 ms) : 0, 185330
Debugger [baseline] (66.089 ms) : 0, 66089
Debugger [candidate] (66.042 ms) : 0, 66042
Remote Config [baseline] (610.139 µs) : 0, 610
Remote Config [candidate] (597.019 µs) : 0, 597
Telemetry [baseline] (8.383 ms) : 0, 8383
Telemetry [candidate] (8.68 ms) : 0, 8680
Flare Poller [baseline] (3.482 ms) : 0, 3482
Flare Poller [candidate] (3.569 ms) : 0, 3569
IAST [baseline] (24.527 ms) : 0, 24527
IAST [candidate] (24.499 ms) : 0, 24499
section iast
crashtracking [baseline] (1.245 ms) : 0, 1245
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (810.709 ms) : 0, 810709
BytebuddyAgent [candidate] (803.104 ms) : 0, 803104
AgentMeter [baseline] (11.739 ms) : 0, 11739
AgentMeter [candidate] (11.639 ms) : 0, 11639
GlobalTracer [baseline] (241.278 ms) : 0, 241278
GlobalTracer [candidate] (240.594 ms) : 0, 240594
AppSec [baseline] (32.876 ms) : 0, 32876
AppSec [candidate] (32.657 ms) : 0, 32657
Debugger [baseline] (64.018 ms) : 0, 64018
Debugger [candidate] (63.67 ms) : 0, 63670
Remote Config [baseline] (543.841 µs) : 0, 544
Remote Config [candidate] (525.492 µs) : 0, 525
Telemetry [baseline] (9.333 ms) : 0, 9333
Telemetry [candidate] (9.544 ms) : 0, 9544
Flare Poller [baseline] (3.643 ms) : 0, 3643
Flare Poller [candidate] (3.526 ms) : 0, 3526
IAST [baseline] (25.956 ms) : 0, 25956
IAST [candidate] (25.792 ms) : 0, 25792
section profiling
crashtracking [baseline] (1.177 ms) : 0, 1177
crashtracking [candidate] (1.222 ms) : 0, 1222
BytebuddyAgent [baseline] (694.793 ms) : 0, 694793
BytebuddyAgent [candidate] (709.085 ms) : 0, 709085
AgentMeter [baseline] (9.224 ms) : 0, 9224
AgentMeter [candidate] (9.396 ms) : 0, 9396
GlobalTracer [baseline] (207.753 ms) : 0, 207753
GlobalTracer [candidate] (210.732 ms) : 0, 210732
AppSec [baseline] (32.985 ms) : 0, 32985
AppSec [candidate] (33.605 ms) : 0, 33605
Debugger [baseline] (66.273 ms) : 0, 66273
Debugger [candidate] (66.919 ms) : 0, 66919
Remote Config [baseline] (586.03 µs) : 0, 586
Remote Config [candidate] (594.373 µs) : 0, 594
Telemetry [baseline] (7.838 ms) : 0, 7838
Telemetry [candidate] (8.199 ms) : 0, 8199
Flare Poller [baseline] (3.508 ms) : 0, 3508
Flare Poller [candidate] (3.611 ms) : 0, 3611
ProfilingAgent [baseline] (94.185 ms) : 0, 94185
ProfilingAgent [candidate] (95.111 ms) : 0, 95111
Profiling [baseline] (94.758 ms) : 0, 94758
Profiling [candidate] (95.674 ms) : 0, 95674
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.62.0-SNAPSHOT~da57da8687, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1069338
Total [baseline] (8.879 s) : 0, 8878929
Agent [candidate] (1.074 s) : 0, 1073566
Total [candidate] (8.889 s) : 0, 8889051
section iast
Agent [baseline] (1.229 s) : 0, 1228989
Total [baseline] (9.58 s) : 0, 9579735
Agent [candidate] (1.227 s) : 0, 1226716
Total [candidate] (9.586 s) : 0, 9586454
gantt
title insecure-bank - break down per module: candidate=1.62.0-SNAPSHOT~da57da8687, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.247 ms) : 0, 1247
crashtracking [candidate] (1.245 ms) : 0, 1245
BytebuddyAgent [baseline] (641.539 ms) : 0, 641539
BytebuddyAgent [candidate] (642.291 ms) : 0, 642291
AgentMeter [baseline] (29.95 ms) : 0, 29950
AgentMeter [candidate] (30.042 ms) : 0, 30042
GlobalTracer [baseline] (251.53 ms) : 0, 251530
GlobalTracer [candidate] (252.79 ms) : 0, 252790
AppSec [baseline] (32.7 ms) : 0, 32700
AppSec [candidate] (32.9 ms) : 0, 32900
Debugger [baseline] (59.806 ms) : 0, 59806
Debugger [candidate] (59.903 ms) : 0, 59903
Remote Config [baseline] (601.255 µs) : 0, 601
Remote Config [candidate] (598.302 µs) : 0, 598
Telemetry [baseline] (8.088 ms) : 0, 8088
Telemetry [candidate] (8.445 ms) : 0, 8445
Flare Poller [baseline] (7.499 ms) : 0, 7499
Flare Poller [candidate] (8.988 ms) : 0, 8988
section iast
crashtracking [baseline] (1.246 ms) : 0, 1246
crashtracking [candidate] (1.229 ms) : 0, 1229
BytebuddyAgent [baseline] (804.026 ms) : 0, 804026
BytebuddyAgent [candidate] (802.04 ms) : 0, 802040
AgentMeter [baseline] (11.582 ms) : 0, 11582
AgentMeter [candidate] (11.58 ms) : 0, 11580
GlobalTracer [baseline] (240.174 ms) : 0, 240174
GlobalTracer [candidate] (239.951 ms) : 0, 239951
AppSec [baseline] (29.066 ms) : 0, 29066
AppSec [candidate] (29.752 ms) : 0, 29752
Debugger [baseline] (66.35 ms) : 0, 66350
Debugger [candidate] (66.29 ms) : 0, 66290
Remote Config [baseline] (552.521 µs) : 0, 553
Remote Config [candidate] (530.404 µs) : 0, 530
Telemetry [baseline] (9.338 ms) : 0, 9338
Telemetry [candidate] (9.593 ms) : 0, 9593
Flare Poller [baseline] (3.574 ms) : 0, 3574
Flare Poller [candidate] (3.585 ms) : 0, 3585
IAST [baseline] (26.734 ms) : 0, 26734
IAST [candidate] (25.908 ms) : 0, 25908
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 20 metrics, 15 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~da57da8687, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section baseline
no_agent (17.988 ms) : 17808, 18167
. : milestone, 17988,
appsec (18.675 ms) : 18487, 18863
. : milestone, 18675,
code_origins (18.207 ms) : 18025, 18389
. : milestone, 18207,
iast (17.761 ms) : 17587, 17934
. : milestone, 17761,
profiling (19.845 ms) : 19644, 20046
. : milestone, 19845,
tracing (17.948 ms) : 17770, 18126
. : milestone, 17948,
section candidate
no_agent (19.301 ms) : 19103, 19499
. : milestone, 19301,
appsec (18.6 ms) : 18413, 18787
. : milestone, 18600,
code_origins (17.857 ms) : 17680, 18034
. : milestone, 17857,
iast (18.059 ms) : 17880, 18237
. : milestone, 18059,
profiling (19.528 ms) : 19332, 19724
. : milestone, 19528,
tracing (18.101 ms) : 17922, 18279
. : milestone, 18101,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~da57da8687, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section baseline
no_agent (1.247 ms) : 1234, 1259
. : milestone, 1247,
iast (3.256 ms) : 3211, 3300
. : milestone, 3256,
iast_FULL (5.92 ms) : 5861, 5979
. : milestone, 5920,
iast_GLOBAL (3.698 ms) : 3635, 3761
. : milestone, 3698,
profiling (2.167 ms) : 2146, 2188
. : milestone, 2167,
tracing (1.866 ms) : 1851, 1882
. : milestone, 1866,
section candidate
no_agent (1.255 ms) : 1242, 1267
. : milestone, 1255,
iast (3.324 ms) : 3276, 3372
. : milestone, 3324,
iast_FULL (6.01 ms) : 5950, 6071
. : milestone, 6010,
iast_GLOBAL (3.698 ms) : 3637, 3760
. : milestone, 3698,
profiling (2.117 ms) : 2097, 2136
. : milestone, 2117,
tracing (1.854 ms) : 1839, 1868
. : milestone, 1854,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~da57da8687, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section baseline
no_agent (1.486 ms) : 1475, 1498
. : milestone, 1486,
appsec (3.814 ms) : 3592, 4036
. : milestone, 3814,
iast (2.274 ms) : 2204, 2343
. : milestone, 2274,
iast_GLOBAL (2.32 ms) : 2250, 2389
. : milestone, 2320,
profiling (2.543 ms) : 2379, 2706
. : milestone, 2543,
tracing (2.104 ms) : 2049, 2158
. : milestone, 2104,
section candidate
no_agent (1.488 ms) : 1476, 1499
. : milestone, 1488,
appsec (3.842 ms) : 3619, 4064
. : milestone, 3842,
iast (2.268 ms) : 2198, 2337
. : milestone, 2268,
iast_GLOBAL (2.309 ms) : 2239, 2379
. : milestone, 2309,
profiling (2.104 ms) : 2049, 2159
. : milestone, 2104,
tracing (2.092 ms) : 2038, 2146
. : milestone, 2092,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~da57da8687, baseline=1.62.0-SNAPSHOT~081af53226
dateFormat X
axisFormat %s
section baseline
no_agent (14.846 s) : 14846000, 14846000
. : milestone, 14846000,
appsec (14.244 s) : 14244000, 14244000
. : milestone, 14244000,
iast (17.982 s) : 17982000, 17982000
. : milestone, 17982000,
iast_GLOBAL (18.032 s) : 18032000, 18032000
. : milestone, 18032000,
profiling (15.332 s) : 15332000, 15332000
. : milestone, 15332000,
tracing (14.718 s) : 14718000, 14718000
. : milestone, 14718000,
section candidate
no_agent (15.382 s) : 15382000, 15382000
. : milestone, 15382000,
appsec (14.64 s) : 14640000, 14640000
. : milestone, 14640000,
iast (18.552 s) : 18552000, 18552000
. : milestone, 18552000,
iast_GLOBAL (18.126 s) : 18126000, 18126000
. : milestone, 18126000,
profiling (15.776 s) : 15776000, 15776000
. : milestone, 15776000,
tracing (15.004 s) : 15004000, 15004000
. : milestone, 15004000,
|
Test Environment - sbt-scalatestJob Status: success
|
Test Environment - nebula-release-pluginJob Status: success
|
Test Environment - reactive-streams-jvmJob Status: success
|
Test Environment - netflix-zuulJob Status: success
|
Test Environment - pass4sJob Status: success
|
Test Environment - sonar-kotlinJob Status: success
|
Test Environment - jolokiaJob Status: success
|
Test Environment - okhttpJob Status: success
|
Test Environment - spring_bootJob Status: success
|
Test Environment - sonar-javaJob Status: success
|
sarahchen6
left a comment
There was a problem hiding this comment.
Looks good on the LP end!
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
The merge request has been interrupted because the build 0 took longer than expected. The current limit for the base branch 'master' is 120 minutes. |
What Does This Do
Adds Bazel-focused CI Visibility support with two offline execution modes, mirroring dd-trace-go#4503 and dd-trace-py#17197:
DD_TEST_OPTIMIZATION_MANIFEST_FILE): reads settings, known tests, flaky tests, and test management data from pre-fetched JSON cache files instead of hitting the backend.DD_TEST_OPTIMIZATION_PAYLOADS_IN_FILES): writes CI test cycle, coverage, and tracer telemetry to$TEST_UNDECLARED_OUTPUTS_DIR/payloads/{tests,coverage,telemetry}/*.jsoninstead of POSTing them.Key Changes
BazelMode(internal-api): detects both modes, resolves the manifest path via Bazel's rlocation algorithm, parses theversion=<int>header, and exposes thetests/,coverage/, andtelemetry/output directories.FileBasedConfigurationApi(agent-ci-visibility): reads the same JSON envelopes as the HTTP API from disk; null paths return safe defaults.FileBasedPayloadDispatcher(dd-trace-core): serializes CI test cycle and coverage spans as JSON files; stripsci.*/git.*/runtime.*/os.*tags to avoid cache invalidation; atomic temp-file + rename. Writestrace_id/span_id/parent_idas unsigned 64-bit JSON numbers (not strings) so backend schema validation passes.FileBasedTelemetryClient(telemetry): subclass ofTelemetryClientthat writes the existing Moshi-encoded telemetry request body to a file;TelemetryRoutergets a single-client path that skips feature discovery;TelemetrySystemswaps in the file-based client when Bazel mode is active.WriterFactory/CiVisibilityServices/CiVisibilityRepoServices: wire the file-based dispatcher/config API, disable the git client, and skip git-data upload when Bazel mode is active.CoreTracer: in Bazel payload-files mode, usesStreamingTraceCollector(streams each CI Visibility span individually) andDDIntakeTraceInterceptor(not the APM-protocol interceptor, which stripstest_{session,module,suite}_endspans) — same treatment as agentless, so all CITESTCYCLE events reach the file dispatcher.JUnit4TracingListener/JUnit4Utils: lazy-register the test suite intestStartedso runners that don't firetestSuiteStartedstill produce a proper suite span; unwrapcom.google.testing.junit.junit4.runner.RunNotifierWrapperinrunListenersFromRunNotifierso the idempotency check sees listeners installed on the inner notifier (fixes duplicate-listener installation underBazelTestRunner).Config: addsDD_TEST_OPTIMIZATION_MANIFEST_FILEandDD_TEST_OPTIMIZATION_PAYLOADS_IN_FILES; skips API-key validation in these modes.TEST_UNDECLARED_OUTPUTS_DIRis read directly inBazelMode(it's a Bazel-provided env var, not a DD config).Motivation
Bazel can run tests in hermetic sandboxes with no network access. The existing CI Visibility pipeline requires HTTP calls to fetch configuration and submit payloads, which is incompatible with Bazel's execution model. Most of our operations, such as tagging tests with git metadata, also invalid Bazel's cache. This PR enables CI Visibility under Bazel by reading configuration from pre-fetched cache files and writing payloads/telemetry to files, with the orchestration of everything else being handled by our custom testing rule.
Additional Notes
BazelModeTest,FileBasedConfigurationApiTest(shares the existing*-response.ftlfixtures withConfigurationApiImplTestto keep the HTTP and file code paths in sync),FileBasedPayloadDispatcherTest,FileBasedTelemetryClientTest, and extendedTelemetryRouterSpecification.DataDog/rules_test_optimization_tests: 3test+ 1test_suite_end+ 1test_module_end+ 1test_session_endevents emitted to the payload file, no duplicate listener errors, no schema-validation failures.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsJira ticket: SDTEST-3335
Note: Once your PR is ready to merge, add it to the merge queue by commenting `/merge`. `/merge -c` cancels the queue request. `/merge -f --reason "reason"` skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.